{{ header }}{{ column_left }}
<div id="content">
  <div class="page-header">
    <div class="container-fluid">
      <div class="float-end">
        <button type="submit" form="form-module" data-bs-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fa-solid fa-save"></i></button>
        <a href="{{ back }}" data-bs-toggle="tooltip" title="{{ button_back }}" class="btn btn-light"><i class="fa-solid fa-reply"></i></a></div>
      <h1>{{ heading_title }}</h1>
      <ol class="breadcrumb">
        {% for breadcrumb in breadcrumbs %}
          <li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
        {% endfor %}
      </ol>
    </div>
  </div>
  <div class="container-fluid">
  <!--
    <div class="alert alert-info"><i class="fa-solid fa-circle-exclamation"></i> {{ text_description }}</div>
    -->
    <div class="card">
      <div class="card-header"><i class="fa-solid fa-pencil"></i> {{ text_edit }}</div>
      <div class="card-body">
        <form id="form-module" action="{{ save }}" method="post" data-oc-toggle="ajax">

          
          <div class="row mb-3">
            <label for="input-status" class="col-sm-2 col-form-label">{{ entry_status }}</label>
            <div class="col-sm-10">
              <div class="form-check form-switch form-switch-lg">
                <input type="hidden" name="module_laguageautocomplite_status" value="0"/>
                <input type="checkbox" name="module_laguageautocomplite_status" value="1" id="input-status" class="form-check-input"{% if module_laguageautocomplite_status %} checked{% endif %}/>
              </div>
            </div>
          </div>

          <div class="row mb-3">
            <label for="module_laguageautocomplite_rewrite" class="col-sm-2 col-form-label">REWRITE</label>
            <div class="col-sm-10">
              <div class="form-check form-switch form-switch-lg">
                <input type="hidden" name="module_laguageautocomplite_rewrite" value="0"/>
                <input type="checkbox" name="module_laguageautocomplite_rewrite" value="1" id="module_laguageautocomplite_rewrite" class="form-check-input"{% if module_laguageautocomplite_rewrite %} checked{% endif %}/>
                
              </div>
              <div class="mt-2">Overwrite field even if it's already translated</div>
            </div>
          </div>



<div class="row mb-3">
            <label for="module_api_key" class="col-sm-2 col-form-label">API KEY</label>
            <div class="col-sm-10">
              <div class="">
                <input type="text" name="module_laguageautocomplite_api_key" value="{{ module_laguageautocomplite_api_key }}" class="form-control">  
              </div>
              <div class="mt-2">Get API key for Free (<a href="https://cloudapi.stream/dev/sign-up" target="_blank">https://cloudapi.stream/dev/sign-up</a>)</div>
            </div>
          </div>



<div class="row mb-3">
            <label for="module_balance_characters" class="col-sm-2 col-form-label">Characters<br><small style="font-weight:100;">on your account in <a href="https://cloudapi.stream/dev/sign-up" target="_blank">cloudapi.stream</a></small></label>
            <div class="col-sm-10">
              <div class="">
                <h2 style="margin-top:20px;" id="get_quota">0</h2>
              </div>
            </div>
          </div>


        </form>
      </div>
    </div>
  </div>
</div>


<script>

      setInterval(function(){
        get_quota();
      },1000);

      function get_quota(){				
				$.ajax( 'index.php?route=extension/laguageautocomplite/module/laguageautocomplite|get_quota&user_token={{ user_token }}', {
					type: 'POST',
					data: { action: 'get_quota' },
					//async: false,
					success: (resp) =>{
						if( resp.result == true ){
              $("#get_quota").html(resp.quota);
            } else {
              $("#get_quota").html("--");
            }
					}
				});
			} 


</script>

{{ footer }}
